@(advertisementForm: Form[Advertisement], categories: List[Category])

@import helper._

@main("Ad product") {
    
    <h3>Advertisement Upload</h3>
        
    @form(action = controllers.advertisement.routes.AdvertisementController.upload(), 'enctype -> "multipart/form-data") {
        <fieldset>
        @inputText(advertisementForm("name"), '_label -> "Name:") 
        @inputText(advertisementForm("price"), '_label -> "Price:")
        <!--@inputText(advertisementForm("description"), '_label -> "Description:")-->
				@helper.input(field = advertisementForm("description"), '_label -> "Description:") { (id, name, value, args) =>
				    <div>
        			<textarea name="@name" id="@id" rows='3' cols='50'>@value</textarea>
				    </div>
				}
				<p>Category:</p>
				<select name="category_id">
					<option value="">-- Choose a category --</option>
					@for(cat <- categories){
						<option value="@cat.getId()">@cat.getName()</option>
							@for(children <- cat.getChildren()){
								<option value="@children.getId()">&nbsp;&nbsp;&nbsp;@children.getName()</option>
							}
					}
				</select><br />
			   	 <input type="file" name="photo">
				</fieldset>
		<br />
		<input class="btn btn-default btn-sm" type="submit" value="upload">       
    }     
}
    
